local lingchong = fk.CreateSkill {
  name = "lingling__lingchong",
}

Fk:loadTranslationTable{
  ["lingling__lingchong"] = "伶宠",
  [":lingling__lingchong"] = "出牌阶段限一次，你可以摸三张牌，然后弃置手牌中所有伤害牌。",

  ["#lingling__lingchong"] = "伶宠：摸三张牌，然后弃置所有伤害手牌",
}

lingchong:addEffect("active", {
  anim_type = "drawcard",
  prompt = "#lingling__lingchong",
  can_use = function(self, player)
    return player:usedSkillTimes(lingchong.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    player:drawCards(3, lingchong.name)
    if player.dead then return end
    local cards = table.filter(player:getCardIds("h"), function (id)
      return Fk:getCardById(id).is_damage_card and not player:prohibitDiscard(id)
    end)
    if #cards > 0 then
      room:throwCard(cards, lingchong.name, player, player)
    end
  end,
})

return lingchong
